import 'dart:core';

class DetectionResultModel {
  /**
   * 00 正常
   * 01 存储器故障
   * 02 传感器故障
   * 03 唤醒故障
   */
  final int? sensorState;
  final int? battery;

  /**
   * 比例数据
   */
  final int? ratio;

  /**
   * 高低温数据
   */
  final int? temperature;
  final String? temperatureHex;

  /**
   * 零点数据
   */
  final int? zeroPoint;

  /**
   * 零点补偿
   */
  final int? zeroOffset;

  /**
   * 力矩数据
   */
  final List<int>? torqueList;
  final bool isTorqueNormal;

  /**
   * 传感器类型 01 加速度计 02 陀螺仪
   */
  final int? sensorType;

  /**
   * 加速度数据 计算G
   *   陀螺仪数据 观察静态值
   */
  List<int>? sensorData;
  final String? sensorDataHex;
  final bool result;

  DetectionResultModel({
    this.sensorState,
    this.battery,
    this.ratio,
    this.temperature,
    this.temperatureHex,
    this.zeroPoint,
    this.zeroOffset,
    this.torqueList,
    this.isTorqueNormal = false,
    this.sensorType,
    this.sensorData,
    this.sensorDataHex,
    this.result = false,
  });

  DetectionResultModel copyWith({
    final int? sensorState,
    final int? battery,
    final int? ratio,
    final int? temperature,
    final String? temperatureHex,
    final int? zeroPoint,
    final int? zeroOffset,
    final List<int>? torqueList,
    final bool? isTorqueNormal,
    final int? sensorType,
    List<int>? sensorData,
    final String? sensorDataHex,
    final bool? result,
  }) {
    return DetectionResultModel(
      sensorState: sensorState ?? this.sensorState,
      battery: battery ?? this.battery,
      ratio: ratio ?? this.ratio,
      temperature: temperature ?? this.temperature,
      temperatureHex: temperatureHex ?? this.temperatureHex,
      zeroPoint: zeroPoint ?? this.zeroPoint,
      zeroOffset: zeroOffset ?? this.zeroOffset,
      torqueList: torqueList ?? this.torqueList,
      isTorqueNormal: isTorqueNormal ?? this.isTorqueNormal,
      sensorType: sensorType ?? this.sensorType,
      sensorData: sensorData ?? this.sensorData,
      sensorDataHex: sensorDataHex ?? this.sensorDataHex,
      result: result ?? this.result,
    );
  }

  @override
  String toString() {
    return 'DetectionResultModel{sensorState: $sensorState, battery: $battery, ratio: $ratio, temperature: $temperature, temperatureHex: $temperatureHex, zeroPoint: $zeroPoint, zeroOffset: $zeroOffset, torqueList: $torqueList, isTorqueNormal: $isTorqueNormal, sensorType: $sensorType, sensorData: $sensorData, sensorDataHex: $sensorDataHex, result: $result}';
  }
}
